﻿using System;
using System.Data;
using System.Collections.Generic;

using Maticsoft.Common;
using CustomsSystem.Model;
using CustomsSystem.DAL;

namespace CustomsSystem.BLL
{
    public class EmpManage
    {
        public readonly EmpService dal = new EmpService();

        /// <summary>
        /// 是否存在记录
        /// </summary>
        public bool Exists(string strWhere)
        {
            return dal.Exists(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        public DataSet GetList()
        {
            return dal.GetList(string.Empty);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CustomsSystem.Model.Info_emp GetModel(string empNum)
        {
            return dal.GetModel(empNum);
        }
        public CustomsSystem.Model.Info_emp GetModel(DataTable dt)
        {
            return dal.DataRowToModel(dt.Rows[0]);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(CustomsSystem.Model.Info_emp model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CustomsSystem.Model.Info_emp model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string empNum)
        {
            return dal.Delete(empNum);
        }

    }
}
